package com.ruoyi.lhky.controller;

import com.ruoyi.lhky.service.StatusService;
import com.ruoyi.lhky.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/status")
@Tag(name = "状态获取", description = "获取所有CRF状态")
public class StatusAppController {
    @Autowired
    private StatusService statusService;

    @GetMapping("/getStatus")
    @Operation(summary = "CRF状态获取", description = "获取所有CRF状态")
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "保存成功"),
            @ApiResponse(responseCode = "400", description = "请求参数错误"),
            @ApiResponse(responseCode = "500", description = "服务器内部错误")
    })
    public R getByTesterId(Long testerId){
        System.out.println(statusService.getStatusByTesterId(testerId));
        return new R(true,statusService.getStatusByTesterId(testerId));
    }
}
